Preface
3
To be fair, if you want to introduce a novice to Unix in 2019 you have to face 50 years of history
and a legacy of countless choices that sound perfectly reasonable to people who grew up into them.
There are at least two widespread implementations of it, Linux and Mac OS X, the first of which
comes in dozens of different flavours (distributions) and the second of which behaves in all sorts of
unexpected ways.
So, I had to compromise. In particular, dear expert nitpicker, you will notice that I use the terms
“Unix”, “Unix shell”, “bash”, “terminal” as synonyms. And believe me, I cringe every time I do it.
But, to be honest, this book wants to be a primer for people who don’t know anything about what is
arguably a niche subject. And my experience tells me that the best way to dishearten someone is to
make them feel stupid, flooding the conversation or the lesson with tons of terms they never heard
and that they do not understand. Sure, this makes you shine, but what’s the point?
So, sorry. I know the nomenclature in the book is all but accurate, and I hope that novices will come
back to this book after some years, smiling at the levity with which I desecrated the holy ground of
Unix.
The prompt
The command line always prints a fixed string in front of each line when waiting for input. This is
aptly called prompt. The prompt is highly customisable, as it is an invaluable source of information
to have handy. My prompt, for example, typically contains the full path of the directory I’m in at the
moment so that I have a clear idea of my position at any time. Many people add the current time,
or the Git branch they are in at the moment. Since the prompt changes from system to system, and
from user to user, it is custom to represent it with a dollar sign $. So this
$ command --option value --another-option another-value
means that you are supposed to type the string from command, as the $ is already there in some form
on your terminal.
I will often show the output of the command as it appears on the terminal, just under the prompt,
like this
$ command --option value --another-option another-value
output line 1
output line 2
output line 3
output line 4
output line 5
I will include the output of the command when it is relevant for the explanation and generally when
it is not too long. The idea of the book is that the reader should test the commands on their terminal,
so I consider it pointless to fill pages with output that nobody will ever read. When I need to truncate
the output I will include an ellipsis between square brackets as in the following example